<?php use_javascript('/js/basket/script.js'); ?>
<div class="thumbbox">
	<div class="thumbboxmain">
	    <div class="toodebigbox">
		<?php foreach($pager->getResults() as $index => $prod): ?>
                <?php $link = LinkGen::getInstance(LinkGen::PRODUCT)->link($prod['id'])?>
		<div class="toodebig<?php if($index % 3 == 0)echo " first"; elseif($index % 3 == 2)echo "last"; ?>">
		    <div class="toodewrap">
			<div class="toodebigtop">
                          <a href="<?php echo $link ?>"><img src="<?php echo @myPicture::getInstance($prod['Product']['ProductPictures'][0]['file'])->thumbnail(70,100)->url() ?>" width="70" height="100" alt=""/></a>
			</div>
			<div class="toodebigmain">
			    <p><a href="<?php echo $link ?>"><?php echo strlen($prod['name']) > 45 ? substr($prod['name'],0,42).'...' : $prod['name']; ?></a></p>
			    <h1><a href="<?php echo $link ?>"><?php echo price_format($prod['price_actual']) ?></a></h1>
			</div>

			<div class="toodebigbottom">
			    <!-- <a href="#"><img src="/enermaatik/img/bl.png" width="31" height="33" alt=""/></a> -->
			    <a class="addToBasket" href="<?php echo LinkGen::getInstance(LinkGen::RAW_ACTION)->link(null, array_merge(
			array('module' => 'basketPage', 'action' => 'addProductToBasket', 'productID' => $prod['Product']['id']),
			array()));  ?>"><img src="/enermaatik/img/korvsmall.png" width="31" height="33" alt=""/></a>
			</div>
		    </div>
		</div>
		<?php endforeach; ?>
	    </div>
	    <div class="clear"></div>
	</div>
	<div class="thumbboxbottom">
	    <img src="/enermaatik/img/thumbbottom.png" width="541" height="8" alt=""/>
	</div>
</div>
<script type="text/javascript">
	$('.addToBasket').addProductToBasket();

	$('#qty_box').change(function(){
		$('input[name=qty]').val($(this).val());
	});
</script>